﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace TreasureBox.Utility
{
    public class FileProcess
    {
        public static void WritingFile(string FileName, string Gmail, string Password)
        {
            TextWriter tw = new StreamWriter(FileName);

            tw.WriteLine(DateTime.Now);
            tw.WriteLine(Gmail);
            tw.WriteLine(Password);
            tw.Close();
        }

        public static string ReadingFile(string FileName)
        {
            string txtContent;
            StreamReader sr = new StreamReader(FileName);
            txtContent = sr.ReadToEnd();
            sr.Close();
            return txtContent;
        }



        public static void AppendingFile(string FileName, string Gmail, string Password)
        {
            StreamWriter sw = File.AppendText(FileName);
            sw.WriteLine(DateTime.Now);
            sw.WriteLine(Gmail);
            sw.WriteLine(Password);
            sw.WriteLine("---------------------------------------------------------------------");
            sw.Close();
        }
    }

}